package com.flat.paas.portal.controller;


import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSON;
import com.flat.paas.portal.domain.Dictionaries;
import com.flat.paas.portal.service.DictionariesService;

@RestController
@RequestMapping("dictionaries")
public class DictionariesController {
	private final Logger logger=LoggerFactory.getLogger(this.getClass());
	
	@Resource
	DictionariesService dictionariesService;
	
	@RequestMapping(value="insert",method=RequestMethod.POST)
	public int insertDictionaries(@RequestBody Dictionaries dictionaries){
		
		logger.error("DictionariesController>>>insertDictionaries>>>dictionaries:"+JSON.toJSONString(dictionaries));
		
		
		try {
			return dictionariesService.insert(dictionaries);
		} catch (Exception e) {
			logger.error("DictionariesController>>>insertDictionaries>>>error:"+e);
			throw e;
		}
	}
}
